package com.sheyu.mall.product.entity.sku;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.sheyu.common.commonEntity.DeletedEntity;
import com.sheyu.mall.product.valid.AddGroup;
import com.sheyu.mall.product.valid.ListValue;
import com.sheyu.mall.product.valid.UpdateGroup;
import com.sheyu.mall.product.valid.Updatestatus;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * sku图片
 *
 * @author sheyu
 * @email sheyu@XXX.com
 * @date 2020-07-27 12:44:31
 */
@Data
@TableName("pms_sku_images")
public class SkuImagesEntity extends DeletedEntity {
	/**
	 * id
	 */
	@TableId
	private Long id;
	/**
	 * sku_id
	 */
	@NotNull(message = "skuId不能为空")
	private Long skuId;
	/**
	 * 图片地址
	 */
	@NotEmpty
	@URL(message = "imgUrl必须是一个合法的地址")
	private String imgUrl;
	/**
	 * 排序
	 */
	@NotNull
	@Min(value = 0,message = "排序的数值必须大于等于0")
	private Integer imgSort;
	/**
	 * 默认图[0 - 不是默认图，1 - 是默认图]
	 */
	@ListValue(vals = {0,1},message = "必须提交0与1")
	private Integer defaultImg;

}
